package com.gitee.tje.waving.beans.property;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 配置结合
 *
 * @author taojiaen
 * @date 2018-01-08 08:31
 */
public class PropertyValues {
    public Map<String, PropertyValue> propertiesValues = new HashMap<>();


    public void addValue(String field, String value) {
        propertiesValues.put(field, new PropertyValue(field, value));
    }
    public void addRef(String field, String ref) {
        PropertyReferHolder referHolder = new PropertyReferHolder(ref);


        PropertyValue value = new PropertyValue(field, referHolder);
        propertiesValues.put(field, value);
    }
    public void addList(String field, List<Object> listObj) {
        PropertyListHolder listHolder = new PropertyListHolder();
        for (Object o : listObj) {
           listHolder.addValue(o);
        }
        propertiesValues.put(field, new PropertyValue(field, listHolder));
    }
}
